package model;

/**
 *
 * @author Martin Mohr Pedersen
 */
public class SaleLineItem {

    private int qty;
    private Item item;

    public SaleLineItem(Item item, int qty) {
        this.item = item;
        this.qty = qty;
    }

    public Item getItem() {
        return item;
    }

    public int getQty() {
        return qty;
    }

    public void setQty(int qty) {
        this.qty = qty;
    }

    /**
     * Calculates total cost of this line (price multiplied by quantity)
     * @return
     */
    public double getTotal() {
        return item.getTotalPrice() * qty;
    }
    
}
